package com.itheima.domain;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) throws IOException {
//        保存键盘录入的数据
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名:");
        String userName = sc.next();
        System.out.println("请输入密码：");
        String passWord = sc.next();

        FileWriter fw = new FileWriter("Module2\\a.txt");
        fw.write(userName);
//        windows系统中的回车换行符：\r\n
//        mac系统中的回车换行符：\r
//        Linux系统中的回车换行符：\n
        fw.write("\r\n");
        fw.write(passWord);
        fw.flush();

        fw.close();
    }
}
